<template>
  <div class="home">
    <h1>首页</h1>
    <el-button @click="onClickDebounce">lodash的debounce</el-button>
  </div>
</template>

<script lang="ts">
import { clog } from "@/utils";

let _ = require("lodash");

export default {
  name: "home",
  setup() {
    const onClick = () => {
      clog(`debounce`);
    };

    const onClickDebounce = _.debounce(onClick, 1000, false);

    return {
      onClickDebounce,
    };
  },
};
</script>
